<!DOCTYPE html>


  <html class="dark page-post">


<head><meta name="generator" content="Hexo 3.9.0">
  <meta charset="utf-8">
  
  <title>React Native打包前凑之iOS证书配置 | Poetry&#39;s Blog</title>

  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

  
    <meta name="keywords" content="RN,IOS证书,">
  

  <meta name="description" content="iOS证书配置   一、Overview 我们都知道开发一款应用需要配置苹果常用证书、AppId,Provisioning Profiles，如果有推送还需要配置推送证书等  二、App ID App ID 是每个应用的独立标识，在设置中可以配置该应用的权限，比如：Push Notifications、Network Extensions等。  三、开发者证书 iOS证书是用来证明iOS App">
<meta name="keywords" content="RN,IOS证书">
<meta property="og:type" content="article">
<meta property="og:title" content="React Native打包前凑之iOS证书配置">
<meta property="og:url" content="http://blog.poetries.top/2019/10/03/rn-ios-cert-config/index.html">
<meta property="og:site_name" content="Poetry&#39;s Blog">
<meta property="og:description" content="iOS证书配置   一、Overview 我们都知道开发一款应用需要配置苹果常用证书、AppId,Provisioning Profiles，如果有推送还需要配置推送证书等  二、App ID App ID 是每个应用的独立标识，在设置中可以配置该应用的权限，比如：Push Notifications、Network Extensions等。  三、开发者证书 iOS证书是用来证明iOS App">
<meta property="og:locale" content="zh-Hans">
<meta property="og:image" content="https://poetries1.gitee.io/img-repo/2019/10/693.png">
<meta property="og:image" content="https://poetries1.gitee.io/img-repo/2019/10/694.png">
<meta property="og:image" content="https://poetries1.gitee.io/img-repo/2019/10/695.png">
<meta property="og:image" content="https://poetries1.gitee.io/img-repo/2019/10/696.png">
<meta property="og:image" content="https://poetries1.gitee.io/img-repo/2019/10/697.png">
<meta property="og:image" content="https://poetries1.gitee.io/img-repo/2019/10/698.png">
<meta property="og:image" content="https://poetries1.gitee.io/img-repo/2019/10/699.png">
<meta property="og:image" content="https://poetries1.gitee.io/img-repo/2019/10/699.jpg">
<meta property="og:image" content="https://poetries1.gitee.io/img-repo/2019/10/701.png">
<meta property="og:image" content="https://poetries1.gitee.io/img-repo/2019/10/702.png">
<meta property="og:image" content="https://poetries1.gitee.io/img-repo/2019/10/703.png">
<meta property="og:image" content="https://poetries1.gitee.io/img-repo/2019/10/704.png">
<meta property="og:image" content="https://poetries1.gitee.io/img-repo/2019/10/705.png">
<meta property="og:image" content="https://poetries1.gitee.io/img-repo/2019/10/706.png">
<meta property="og:image" content="https://poetries1.gitee.io/img-repo/2019/10/707.png">
<meta property="og:image" content="https://poetries1.gitee.io/img-repo/2019/10/708.png">
<meta property="og:updated_time" content="2020-08-15T04:25:31.934Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="React Native打包前凑之iOS证书配置">
<meta name="twitter:description" content="iOS证书配置   一、Overview 我们都知道开发一款应用需要配置苹果常用证书、AppId,Provisioning Profiles，如果有推送还需要配置推送证书等  二、App ID App ID 是每个应用的独立标识，在设置中可以配置该应用的权限，比如：Push Notifications、Network Extensions等。  三、开发者证书 iOS证书是用来证明iOS App">
<meta name="twitter:image" content="https://poetries1.gitee.io/img-repo/2019/10/693.png">

  

  
    <link rel="icon" href="/favicon.ico">
  

  <link href="/css/styles.css?v=c114cbeddx" rel="stylesheet">
<link href="/css/other.css?v=c114cbeddx" rel="stylesheet">


  
    <link rel="stylesheet" href="/css/personal-style.css">
  

  

  
  <script type="text/javascript">
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "//hm.baidu.com/hm.js?40b1f89aa80f2527b3db779c6898c879";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>


  
  <script type="text/javascript">
	(function(){
	    var bp = document.createElement('script');
	    var curProtocol = window.location.protocol.split(':')[0];
	    if (curProtocol === 'https') {
	        bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';        
	    }
	    else {
	        bp.src = 'http://push.zhanzhang.baidu.com/push.js';
	    }
	    var s = document.getElementsByTagName("script")[0];
	    s.parentNode.insertBefore(bp, s);
	})();
  </script>



  
    <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
    <link rel="stylesheet" href="//cdn.bootcss.com/font-awesome/4.3.0/css/font-awesome.min.css">
  

  <!-- 聊天系统 -->
  
    
   <link type="text/css" rel="stylesheet" href="/renxi/default.css">
   <style>
      #modal {
        position: static !important;
      }
      .filter {
        width: 100%;
        height: 100%;
        position: absolute;
        top: 0;
        left: 0;
        background: #fe5757;
        animation: colorChange 30s ease-in-out infinite;
        animation-fill-mode: both;
        mix-blend-mode: overlay;
      }
  
      @keyframes colorChange {
        0%, 100% {
            opacity: 0;
        }
        50% {
            opacity: .9;
        }
      }
   </style>
</head>
</html>
<body>
  
  
    <span id="toolbox-mobile" class="toolbox-mobile">导航</span>
  

  <div class="post-header CENTER">
   
  <div class="toolbox">
    <a class="toolbox-entry" href="/">
      <span class="toolbox-entry-text">导航</span>
      <i class="icon-angle-down"></i>
      <i class="icon-home"></i>
    </a>
    <ul class="list-toolbox">
      
        <li class="item-toolbox">
          <a
            class="CIRCLE"
            href="/archives/"
            rel="noopener noreferrer"
            target="_self"
            >
            博客
          </a>
        </li>
      
        <li class="item-toolbox">
          <a
            class="CIRCLE"
            href="/categories/"
            rel="noopener noreferrer"
            target="_self"
            >
            分类
          </a>
        </li>
      
        <li class="item-toolbox">
          <a
            class="CIRCLE"
            href="/tags/"
            rel="noopener noreferrer"
            target="_self"
            >
            标签
          </a>
        </li>
      
        <li class="item-toolbox">
          <a
            class="CIRCLE"
            href="/search/"
            rel="noopener noreferrer"
            target="_self"
            >
            搜索
          </a>
        </li>
      
        <li class="item-toolbox">
          <a
            class="CIRCLE"
            href="/link/"
            rel="noopener noreferrer"
            target="_self"
            >
            友链
          </a>
        </li>
      
        <li class="item-toolbox">
          <a
            class="CIRCLE"
            href="/about/"
            rel="noopener noreferrer"
            target="_self"
            >
            关于
          </a>
        </li>
      
    </ul>
  </div>


</div>


  <div id="toc" class="toc-article">
    <strong class="toc-title">文章目录<i class="iconfont toc-title" style="display:inline-block;color:#87998d;width:20px;height:20px;">&#xf004b;</i></strong>
    <ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#一、Overview"><span class="toc-text">一、Overview</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#二、App-ID"><span class="toc-text">二、App ID</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#三、开发者证书"><span class="toc-text">三、开发者证书</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#四、推送证书"><span class="toc-text">四、推送证书</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#五、配置文件（Provisioning-Profiles）"><span class="toc-text">五、配置文件（Provisioning Profiles）</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#六、创建CSR文件（证书请求文件）"><span class="toc-text">六、创建CSR文件（证书请求文件）</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#创建App-ID"><span class="toc-text">创建App ID</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#七、创建开发者证书-和-推送证书"><span class="toc-text">七、创建开发者证书 和 推送证书</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#八、推送证书"><span class="toc-text">八、推送证书</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#创建配置文件（Provisioning-Profiles）"><span class="toc-text">创建配置文件（Provisioning Profiles）</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#九、总结："><span class="toc-text">九、总结：</span></a></li></ol>
  </div>
  




<div class="content content-post CENTER">
   <!-- canvas 彩带 -->
<canvas id="evanyou" width="1302" height="678" style="position: fixed;width: 100%;height: 100%;top: 0;left:0;z-index:-1;"></canvas>

<article id="post-rn-ios-cert-config" class="article article-type-post" itemprop="blogPost">
  <header class="article-header" style="position:relative;">
    <h1 class="post-title">React Native打包前凑之iOS证书配置</h1>

    <div class="article-meta">
      <span>
        <i class="icon-calendar"></i>
        <span>2019.10.03</span>
      </span>

      
        <span class="article-author">
          <i class="icon-user"></i>
          <span>Poetry</span>
        </span>
      

      
  <span class="article-category">
    <i class="icon-list"></i>
    <a class="article-category-link" href="/categories/Front-End/">Front-End</a>
  </span>



      

      
      <i class="fa fa-eye"></i> 
        <span id="busuanzi_container_page_pv">
           &nbsp热度 <span id="busuanzi_value_page_pv">
           <i class="fa fa-spinner fa-spin"></i></span>℃
        </span>
      
      
       
          <span class="post-count">
            <i class="fa fa-file-word-o"></i>&nbsp
            <span>字数统计 2k字</span>
          </span>

          <span class="post-count">
            <i class="fa fa-columns"></i>&nbsp
            <span>阅读时长 7分</span>
          </span>
      
      
    </div>

    <i class="iconfont" id="toc-eye" style="display:inline-block;color:#b36619;position:absolute;top:0;right:0;cursor:pointer;
    font-size: 24px;">&#xe61c;</i>

  </header>

  <div class="article-content">
    
      <div id="container">
        <blockquote>
<p>iOS证书配置</p>
</blockquote>
<p><img src="https://poetries1.gitee.io/img-repo/2019/10/693.png" alt></p>
<h2 id="一、Overview"><a href="#一、Overview" class="headerlink" title="一、Overview"></a>一、Overview</h2><blockquote>
<p>我们都知道开发一款应用需要配置苹果常用证书、<code>AppId</code>,<code>Provisioning Profiles</code>，如果有推送还需要配置推送证书等</p>
</blockquote>
<h2 id="二、App-ID"><a href="#二、App-ID" class="headerlink" title="二、App ID"></a>二、App ID</h2><blockquote>
<p><code>App ID</code> 是每个应用的独立标识，在设置中可以配置该应用的权限，比如：<code>Push Notifications</code>、<code>Network Extensions</code>等。</p>
</blockquote>
<h2 id="三、开发者证书"><a href="#三、开发者证书" class="headerlink" title="三、开发者证书"></a>三、开发者证书</h2><ul>
<li>iOS证书是用来证明iOS App内容（executable code）的合法性和完整性的数字证书。对于想安装到真机或发布到AppStore的应用程序（App），只有经过签名验证（Signature Validated）才能确保来源可信，并且保证App内容是完整、未经篡改的。</li>
<li>数字证书是一个经证书授权中心数字签名的包含公开密钥拥有者信息以及公开密钥的文件。具有时效性，只在特定的时间段内有效。</li>
<li>开发证书类型分为两种，一种开发证书（iOS Development）一种发布证书(iOS Distribution)。开发证书（iOS Development）用于开发和调试应用程序，可用于真机调试；生产证书用于打包上传App Store，用于验证开发者身份</li>
</ul>
<h2 id="四、推送证书"><a href="#四、推送证书" class="headerlink" title="四、推送证书"></a>四、推送证书</h2><blockquote>
<p>如果项目中集成了推送功能，同样需要配置推送证书。推送证书同样也分两种：开发（Apple Development iOS Push Services）、生产（Apple Production iOS Push Services）。推送证书在AppID中创建生成，同时生成的的p12文件需要上传到服务端后台（友盟后台、极光后台或自己服务端后台）</p>
</blockquote>
<h2 id="五、配置文件（Provisioning-Profiles）"><a href="#五、配置文件（Provisioning-Profiles）" class="headerlink" title="五、配置文件（Provisioning Profiles）"></a>五、配置文件（Provisioning Profiles）</h2><blockquote>
<p>配置文件同样也分两种，分为开发（<code>Development</code>）和发布（<code>Distribution</code>），配置文件（<code>Provisioning Profiles</code>）中包含了证书、<code>App ID</code>、设备（Devices），后缀名为<code>.mobileprovision</code>。它在开发者账号体系中扮演着配置和验证的角色，是真机调试和打包上架必须的文件</p>
</blockquote>
<ul>
<li>一个<code>Provisioning Profile</code>对应一个Explicit App ID或Wildcard App ID</li>
<li><code>Provisioning Profile</code>决定<code>Xcode</code>用哪个证书（公钥）/私钥组合（Key Pair/Signing Identity）来签名应用程序（<code>Signing Product</code>）,将在应用程序打包时嵌入到<code>.ipa</code>包里</li>
<li><code>Provisioning Profile</code> 把这些信息全部打包在一起，方便我们在调试和发布程序打包时使用。这样，只要在不同的情况下选择不同的<code>Provisioning Profile</code>文件就可以了</li>
<li><code>Provisioning Profile</code>也分为<code>Development</code>和<code>Distribution</code>两类，有效期同<code>Certificate</code>一样。<code>Development</code>版本的<code>ProvisioningProfile</code>用于开发调试，<code>Distribution</code>版本的<code>ProvisioningProfile</code>主要用于提交<code>App Store</code>审核，其不指定开发测试的<code>Devices</code></li>
</ul>
<blockquote>
<p>ps:打<code>Ad-hoc</code>包的时候，如果遇到刚添加的设备<code>UDID</code>没添加进去，可以将开发模式的配置文件下载下来，打包后直接选中即可</p>
</blockquote>
<p><img src="https://poetries1.gitee.io/img-repo/2019/10/694.png" alt></p>
<p>在配置证书之前我们需要有一个开发账号。个人账号和公司账号类似，每年都需要支付99刀，其中公司账号需要邓白氏编码而个人账号并不需要。</p>
<p>如果项目需要不通过App Store进行安装，可以申请企业账号。当然了，也可以找一些第三方直接打企业包，比如蒲公英之类的</p>
<h2 id="六、创建CSR文件（证书请求文件）"><a href="#六、创建CSR文件（证书请求文件）" class="headerlink" title="六、创建CSR文件（证书请求文件）"></a>六、创建CSR文件（证书请求文件）</h2><blockquote>
<p>CSR（<code>Certificate signing request</code>）即证书请求文件。证书申请者在申请数字证书时由CSP(加密服务提供者)在生成私钥的同时也生成证书请求文件（CSR文件），证书申请者只要把CSR文件提交给证书颁发机构后（创建App ID时上传到苹果后台），证书颁发机构使用其根证书私钥签名生成证书公钥文件（开发者证书）</p>
</blockquote>
<ul>
<li>关于CSR文件的创建，我们可以直接使用Mac上的钥匙串访问直接请求。</li>
</ul>
<p><strong>具体步骤为： 钥匙串访问 -&gt; 钥匙串访问 -&gt; 证书助理 -&gt; 从证书颁发机构请求证书</strong></p>
<p><strong>1、打开电脑上的钥匙串访问，选中证书助理；</strong></p>
<p><img src="https://poetries1.gitee.io/img-repo/2019/10/695.png" alt></p>
<p><strong>2、用户电子邮件地址填开发者账号的邮箱，名称可以随意填，然后保存到磁盘上。</strong></p>
<p><img src="https://poetries1.gitee.io/img-repo/2019/10/696.png" alt></p>
<p><strong>3、Keychain将生成一个包含开发者身份信息的CSR（Certificate Signing Request）文件。同时，Keychain Access-&gt;Keys（密钥）中增加一对Public/Private Key Pair</strong></p>
<h3 id="创建App-ID"><a href="#创建App-ID" class="headerlink" title="创建App ID"></a>创建App ID</h3><p><strong>1、登录苹果开发者中心,或者直接登录Apple Member Center选择Certificates,Identifiers &amp; Profiles</strong></p>
<p><img src="https://poetries1.gitee.io/img-repo/2019/10/697.png" alt></p>
<p><strong>2、选择Identifiers 中的 App IDs，然后点上方的加号；</strong></p>
<p><img src="https://poetries1.gitee.io/img-repo/2019/10/698.png" alt></p>
<p><strong>3、添加App ID Description和Bundle ID</strong></p>
<ul>
<li>在“Explicit App ID”栏下的“Bundle ID”项中输入App ID（反域名格式，如：com.company.test）</li>
<li>这里“Bundle ID”对应Xcode中的“Bundle identifier” Explicit App ID：唯一的App ID，用于唯一标识一个应用程序。例如“com.apple.garageband”这个App ID，用于标识Bundle Identifier为“com.apple.garageband”的App</li>
<li>Wildcard App ID：含有通配符的App ID，用于标识一组应用程序。例如“”（实际上是Application Identifier Prefix）表示所有应用程序；而“com.apple.”可以表示Bundle Identifier以“com.apple.”开头（苹果公司）的所有应用程序。</li>
<li>在“App Services”栏下选择应用要使用到的服务（如要使用推送功能，勾选“Push Notifications”）</li>
<li>点击continue-&gt;点击submit-&gt;点击done，申请App IDs完成。点击All IDs可查看申请的ID，点击该ID</li>
<li>点击 对应名称 可对该App ID进行编辑</li>
</ul>
<h2 id="七、创建开发者证书-和-推送证书"><a href="#七、创建开发者证书-和-推送证书" class="headerlink" title="七、创建开发者证书 和 推送证书"></a>七、创建开发者证书 和 推送证书</h2><p><strong>1、选择Certificates,然后选择上方的加号；</strong></p>
<p><img src="https://poetries1.gitee.io/img-repo/2019/10/699.png" alt></p>
<p><strong>2、选择相应的证书，因为开发调试证书、生产发布证书、开发环境推送证书、生产环境推送证书基本都类似，所以这里只选择开发调试证书为例。</strong></p>
<p><img src="https://poetries1.gitee.io/img-repo/2019/10/699.jpg" alt></p>
<p><strong>3、一路点击Continue, 到Generate后选择一开始生成的CSR文件上传，然后再继续点击Continue</strong></p>
<p><img src="https://poetries1.gitee.io/img-repo/2019/10/701.png" alt></p>
<p><strong>4、生成完开发调试、生成调试证书 和 开发环境推送证书、生成环境推送证书，可以在“Certificates”-&gt;“All”中查看该证书，并进行下载或删除</strong></p>
<p><strong>5、下载到桌面上，然后双击添加到钥匙串中，可在Keychain Access-&gt;“证书”中查看</strong></p>
<blockquote>
<p>使用友盟，生成的推送证书（开发环境和生产环境）需要从钥匙串访问中导出p12文件，添加到友盟后台</p>
</blockquote>
<h2 id="八、推送证书"><a href="#八、推送证书" class="headerlink" title="八、推送证书"></a>八、推送证书</h2><blockquote>
<p>导出p12文件上传到友盟（极光）后台</p>
</blockquote>
<p><strong>1、由上一步创建了开发环境的推送证书和生成环境的推送证书，下载到电脑上后，直接双击即可安装到钥匙串中。</strong></p>
<p><img src="https://poetries1.gitee.io/img-repo/2019/10/702.png" alt></p>
<p><strong>2、选中相应证书（开发环境推送证书或生成环境推送证书）右键 导出；</strong></p>
<p><img src="https://poetries1.gitee.io/img-repo/2019/10/703.png" alt></p>
<p><strong>3、点击存储后需要输入密码，密码要记住，上传到友盟（极光）后台时，需要用到</strong></p>
<p><img src="https://poetries1.gitee.io/img-repo/2019/10/704.png" alt></p>
<h3 id="创建配置文件（Provisioning-Profiles）"><a href="#创建配置文件（Provisioning-Profiles）" class="headerlink" title="创建配置文件（Provisioning Profiles）"></a>创建配置文件（Provisioning Profiles）</h3><p><strong>1、选中Provisioning Profiles 然后选中上方的加号。</strong></p>
<p><img src="https://poetries1.gitee.io/img-repo/2019/10/705.png" alt></p>
<p><strong>2、配置文件也分为开发和发布，我们这里以Ad Hoc为例，因为我们打测试包的时候，如果有些设备的UDID未添加进配置文件中，我们需要下载配置文件手动选择。而其他的的配置文件目前的Xcode会自动请求，所以一般不需要我们自己手动创建</strong></p>
<p><img src="https://poetries1.gitee.io/img-repo/2019/10/706.png" alt></p>
<p><strong>3、选择刚创建的App ID,选择相应证书、选择测试的设备，然后创建名称一直点击Continue即可，最后下载下来</strong></p>
<p><img src="https://poetries1.gitee.io/img-repo/2019/10/707.png" alt><br><img src="https://poetries1.gitee.io/img-repo/2019/10/708.png" alt></p>
<p>到此为止证书和配置文件之类的都创建完了~~</p>
<h2 id="九、总结："><a href="#九、总结：" class="headerlink" title="九、总结："></a>九、总结：</h2><ul>
<li>导出p12证书的时候需要密码，上传到友盟（极光）后台需要输入密码。</li>
<li>开发和生成的推送证书创建成功后，到相应App ID 下查看是否有，如果没有可以停段时间刷新下，或下载下来手动上传上去。</li>
<li>新添加上的测试机的UDID，打包的时候没打包上去，需要重新创建配置文件，下载后将本地的删除，然后双击。不过刚添加UDID，重新创建配置文件后，我一般在打包的时候手动选择配置文件。</li>
</ul>

      </div>
    
  </div>

</article>

<button class="assist-btn2 circle" id="assist_btn2" title="点亮屏幕" style="left: 27px; top: 152px;">
  <i class="iconfont" style="display:inline-block;color:red;width:20px;height:20px;">&#xe61d;</i>
</button>
<button class="assist-btn1 circle" id="assist_btn1" title="关闭屏幕亮度" style="left: 27px; top: 152px;">
  <i class="iconfont toc-title" style="display:inline-block;color:red;width:20px;height:20px;">&#xe61d;</i>
</button>


<script src="//cdn.bootcss.com/jquery/3.1.1/jquery.min.js"></script>	

<script src="https://my.openwrite.cn/js/readmore.js" type="text/javascript"></script>
<script>
  const btw = new BTWPlugin();
  btw.init({
    id: "container",
    blogId: "22699-1592137983091-414",
    name: "前端进阶之旅",
    qrcode: "https://poetries1.gitee.io/img-repo/2020/06/qrcode.jpg",
    keyword: "3a3b3c",
  });
</script>

<script type="text/javascript">

// white theme
var body = {color: "#555", background: "#000"};
var a_tag = {color: "#222"};
var header = { background: "#222"};
var logo_line_i = {background: "#222"};
// var post_code = {background: "#eee", color: "#222"};

function switch_theme() {
 $("body").css(body);
 $("a:not('.links-of-author-item a, .site-state-item a, .site-state-posts a, .feed-link a, .motion-element a, .post-tags a, .show-commit-cls a, #donate_board a')").css(a_tag);
 $(".header, .footer").css(header);
 $(".logo-line-before i, .logo-line-after i").css(logo_line_i);
 //$(".post code").css(post_code);
 $("#idhyt-surprise-ball #idhyt-surprise-ball-animation .drag").css(a_tag);
 $(".post-title-link, .posts-expand .post-meta, .post-comments-count, .disqus-comment-count, .post-category a, .post-nav-next a, .post-nav-item a").css(a_tag);
 
 // $("code").css({color: '#c5c8c6', background: '#1d1f21'});
 //$("#assist_btn1").hide(1500);
}

$(function () {
$("#assist_btn2").css("display","none");
 $("#assist_btn1").click(function() {
     switch_theme();
$("div#toc.toc-article").css({
 "background":"#eaeaea",
 "opacity":1
});
$(".toc-article ol").show();
$("#toc.toc-article .toc-title").css("color","#a98602");
$("#assist_btn1").css("display","none");
$("#assist_btn2").css("display","block");
 });
$("#assist_btn2").click(function() {
$("#assist_btn2").css("display","none");
$("#assist_btn1").css("display","block");
$("body").css("background","url(http://www.miaov.com/static/ie/images/news/bg.png)")
     $(".header, .footer").css("background","url(http://www.miaov.com/static/ie/images/news/bg.png)")
$(".toc-article ol").toggle(1000);
 });
});


//背景随机

var Y, O, E, L, B, C, T, z, N, S, A, I;
!function() {
var e = function() {
for (O.clearRect(0, 0, L, B), T = [{
x: 0,
y: .7 * B + C
}, {
x: 0,
y: .7 * B - C
}]; T[1].x < L + C;) t(T[0], T[1])
}, t = function(e, t) {
O.beginPath(), O.moveTo(e.x, e.y), O.lineTo(t.x, t.y);
var n = t.x + (2 * I() - .25) * C,
 r = a(t.y);
O.lineTo(n, r), O.closePath(), N -= S / -50, O.fillStyle = "#" + (127 * A(N) + 128 << 16 | 127 * A(N + S / 3) + 128 << 8 | 127 * A(N + S / 3 * 2) + 128).toString(16), O.fill(), T[0] = T[1], T[1] = {
 x: n,
 y: r
}
}, a = function n(e) {
var t = e + (2 * I() - 1.1) * C;
return t > B || t < 0 ? n(e) : t
};
Y = document.getElementById("evanyou"), O = Y.getContext("2d"), E = window.devicePixelRatio || 1, L = window.innerWidth, B = window.innerHeight, C = 90, z = Math, N = 0, S = 2 * z.PI, A = z.cos, I = z.random, Y.width = L * E, Y.height = B * E, O.scale(E, E), O.globalAlpha = .6, document.onclick = e, document.ontouchstart = e, e()
}()

   
$("#toc-eye").click(function(){
$("#toc.toc-article").toggle(1000);
});

</script>


   
  <div class="text-center donation">
    <div class="inner-donation">
      <span class="btn-donation">支持一下</span>
      <div class="donation-body">
        <div class="tip text-center">扫一扫，支持poetries</div>
        <ul>
        
          <li class="item">
            
              <span>微信扫一扫</span>
            
            <img src="/images/weixin.jpg" alt="">
          </li>
        
          <li class="item">
            
              <span>支付宝扫一扫</span>
            
            <img src="/images/zhifubao.jpg" alt="">
          </li>
        
        </ul>
      </div>
    </div>
  </div>


   
  <div class="box-prev-next clearfix">
    <a class="show pull-left" href="/2019/10/02/rn-yuanli/">
        <i class="icon icon-angle-left"></i>
    </a>
    <a class="show pull-right" href="/2019/10/03/rn-ios-distribute/">
        <i class="icon icon-angle-right"></i>
    </a>
  </div>




</div>


  <a id="backTop" class="back-top">
    <i class="icon-angle-up"></i>
  </a>




  <div class="modal" id="modal">
  <span id="cover" class="cover hide"></span>
  <div id="modal-dialog" class="modal-dialog hide-dialog">
    <div class="modal-header">
      <span id="close" class="btn-close">关闭</span>
    </div>
    <hr>
    <div class="modal-body">
      <ul class="list-toolbox">
        
          <li class="item-toolbox">
            <a
              class="CIRCLE"
              href="/archives/"
              rel="noopener noreferrer"
              target="_self"
              >
              博客
            </a>
          </li>
        
          <li class="item-toolbox">
            <a
              class="CIRCLE"
              href="/categories/"
              rel="noopener noreferrer"
              target="_self"
              >
              分类
            </a>
          </li>
        
          <li class="item-toolbox">
            <a
              class="CIRCLE"
              href="/tags/"
              rel="noopener noreferrer"
              target="_self"
              >
              标签
            </a>
          </li>
        
          <li class="item-toolbox">
            <a
              class="CIRCLE"
              href="/search/"
              rel="noopener noreferrer"
              target="_self"
              >
              搜索
            </a>
          </li>
        
          <li class="item-toolbox">
            <a
              class="CIRCLE"
              href="/link/"
              rel="noopener noreferrer"
              target="_self"
              >
              友链
            </a>
          </li>
        
          <li class="item-toolbox">
            <a
              class="CIRCLE"
              href="/about/"
              rel="noopener noreferrer"
              target="_self"
              >
              关于
            </a>
          </li>
        
      </ul>

    </div>
  </div>
</div>



  
      <div class="fexo-comments comments-post">
    

    

    
    

    

    
    

    

<!-- Gitalk评论插件通用代码 -->
<div id="gitalk-container"></div>

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.css">
<script src="https://cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.min.js"></script>
<script>
const gitalk = new Gitalk({
  clientID: '5567a2c4abb858009d96',
  clientSecret: 'b9039ec056cf5c2346b3cdb63308a28c163f91e5',
  repo: 'poetries.github.io',
  owner: 'poetries',
  // 在这里设置一下截取前50个字符串, 这是因为 github 对 label 的长度有了要求, 如果超过
  // 50个字符串则会报错.
  // id: location.pathname.split('/').pop().substring(0, 49),
  id: location.pathname,
  admin: ['poetries'],
  // facebook-like distraction free mode
  distractionFreeMode: false
})
gitalk.render('gitalk-container')
</script>
<!-- Gitalk代码结束 -->



  </div>

  

  <script type="text/javascript">
  function loadScript(url, callback) {
    var script = document.createElement('script')
    script.type = 'text/javascript';

    if (script.readyState) { //IE
      script.onreadystatechange = function() {
        if (script.readyState == 'loaded' ||
          script.readyState == 'complete') {
          script.onreadystatechange = null;
          callback();
        }
      };
    } else { //Others
      script.onload = function() {
        callback();
      };
    }

    script.src = url;
    document.getElementsByTagName('head')[0].appendChild(script);
  }

  window.onload = function() {
    loadScript('/js/bundle.js?235683', function() {
      // load success
    });
  }
</script>


  <!-- 页面点击小红心 -->
  <script type="text/javascript" src="/js/clicklove.js"></script>
 
  
</body>
</html>
